import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooCmsFormDataController } from '../../../controllers';
const uctoocmsFormDataRouter = new Router();
const cmsFormDataController = new uctooCmsFormDataController();

uctoocmsFormDataRouter.post('/add', requireUser, cmsFormDataController.add);
uctoocmsFormDataRouter.post('/edit', requireUser, rowLevelPermission('uctoo/cms_form_data'), cmsFormDataController.edit);
uctoocmsFormDataRouter.post('/del', requireUser, rowLevelPermission('uctoo/cms_form_data'), cmsFormDataController.delete);

//For getting cmsFormData with permission control
uctoocmsFormDataRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/cms_form_data'), cmsFormDataController.getSingle);
uctoocmsFormDataRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/cms_form_data'), cmsFormDataController.getMany);
uctoocmsFormDataRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/cms_form_data'), cmsFormDataController.getMany);

//#endregion AutoCreateCode
export default uctoocmsFormDataRouter;
